const path = require("path");
const webpack = require("webpack");
const fs = require("fs");

const resolve = (dir) => {
  return path.join(__dirname, dir);
};
module.exports = {
  publicPath: "./",
  productionSourceMap: false,
  chainWebpack: (config) => {
    config.resolve.alias
      .set("@", resolve("src")) // key,value自行定义，比如.set('@@', resolve('src/components'))
      .set("_c", resolve("src/components"));
  },
  // https://qwzs.jhpress.com/addons/shopro/index/init
  devServer: {
    disableHostCheck: true,
    port: 8888,
    proxy: {
      "/addons": {
        target: "https://qwzs.jhpress.com",
        pathRewrite: {
          ["^/addons"]: "/addons",
        },
        changeOrigin: true,
      },
    },
  },
};
